<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>表格标签练习</title>
</head>
<body>
    <!--
    border:边框宽度 1
    cellspacing:单元格间距 0
    colspan:跨列
    rowspan:跨行
    -->

    <table border="1" cellspacing="0">
        <tr>
            <!--跨列-->
            <td colspan="2" align="center">1-1</td>
            <td rowspan="3">1-3</td>
        </tr>
        <tr>
            <!--跨行-->
            <td rowspan="2">2-1</td>
            <td>2-2</td>
        </tr>
        <tr>
            <td>3-2</td>
        </tr>
        <tr>
            <td colspan="3" align="center">4-1</td>
        </tr>
    </table>
    <hr>
    <!-- 创建3行3列的表格-->
    <table border="1" cellspacing="0">
        <tr>
            <td rowspan="2">1-1</td>
            <td colspan="2" align="center">1-2</td>
        </tr>
        <tr>
            <td>2-2</td>
            <td rowspan="2">2-3</td>
        </tr>
        <tr>
            <td colspan="2" align="center">3-1</td>
        </tr>
    </table>
    <hr>
    <table border="1" cellspacing="0">
        <caption>商品列表</caption>
        <tr>
            <th>编号</th>
            <th>名称</th>
            <th>价格</th>
            <th>库存</th>
        </tr>
        <tr>
            <td>1</td>
            <td>华为手机</td>
            <td>8999</td>
            <td>100</td>
        </tr>
        <tr>
            <td>2</td>
            <td>小米手机</td>
            <td>5999</td>
            <td>168</td>
        </tr>
        <tr>
            <td>3</td>
            <td>oppo手机</td>
            <td>7999</td>
            <td>199</td>
        </tr>
    </table>


</body>
</html>













